Release 10.1A: OpenEdge Development:
Java Open Clients


Miscellaneous management methods

These methods facilitate various management functions on an SDOResultSet, and include standard JDBC 2 methods and extensions to manage SmartDataObjects.

Standard JDBC 2 management methods

The supported standard JDBC 2 management methods include those listed in Table 9–4.

Table 9–4: Standard JDBC 2 management methods
Method
Description
void close() 
Closes the SDOResultSet and releases the underlying SmartDataObject. Any local modifications that have not been sent to the AppServer are lost when this method is called.
int findColumn
(String columnName) 
Returns the column index.
int getFetchSize() 
Returns the size (in number of rows) of the buffer the underlying implementation uses to fetch rows from the AppServer.
void refreshRow() 
Gets the latest version of the current row from the database.
SDOResultSetMetaData 
getMetaData() 
Returns the SDOResultSetMetaData object, which is an extension of the JDBC ResultSetMetaData object.
boolean wasNull() 
Indicates if the last fetched value from a getDatatype() method is equal to the Unknown value (?).
This method is especially useful for methods that return a primitive data type, as in this example where SDOResults is an SDOResultSet:
int cValue;
cValue = SDOResults.getInt("QUANTITY");
if (SDOResults.wasNull())
     return(-1); 
Because a primitive data type cannot hold the null value (the Java object equivalent to the Unknown value (?)), wasNull() provides the equivalent for the int value returned by getInt(). In this example, the method fragment returns the value –1 for a Unknown value (?) because valid integer values for the QUANTITY column must be positive.

SmartDataObject management methods [extension]

The nonstandard SDOResultSet methods listed in Table 9–5 support a variety of features unique to SmartDataObject management.

Note: The rowId value referenced in the following methods is equivalent to the value returned by the 4GL ROWID function and the SDOResultSet.getRowIdentity() method. For more information on ROWID, see OpenEdge Development: Progress 4GL Handbook (or the OpenEdge DataServer Guide for any DataServer accessed by the SmartDataObject).

Table 9–5: Nonstandard SDOResultSet management methods
Method
Description
boolean absolute
(String rowId) 
[Extension] 
Repositions the cursor at the row specified by rowId.
String getQuery() 
[Extension] 
Returns the 4GL query that populated this SDOResultSet object.
String 
getRowIdentity() 
[Extension] 
Gets the string representation of the ROWID value for the current row that can be used as input to reOpenQuery(String rowId), absolute(String rowId), and SDOParameters.setRowIdentity(String rowId).
SDOInterface 
getSDOInterface() 
[Extension] 
Provides direct access to the underlying 4GL methods of the SmartDataObject that are efficient for remote SmartDataObject access. The returned SDOInterface is a ProcObject that includes all relevant public methods provided by the SmartDataObject. Thus, you have full access to these SmartDataObject features without any limit imposed by the SDOResultSet interface. If the SDOResultSet is stateless, calling getSDOInterface() creates a remote SmartDataObject procedure you can delete only by calling releaseSDOInterface(). Calling releaseSDOInterface() on a non-stateless SDOResultSet has no effect.
See “Note on SDOInterface method” below the table.
void 
releaseSDOInterface() 
[Extension] 
On a stateless SDOResultSet, releases the remote SmartDataObject procedure. Calling releaseSDOInterface() on an SDOResultSet that is not Stateless has no effect. This method is used in conjunction with getSDOInterface().
void reOpenQuery() 
[Extension] 
Reopens the SmartDataObject query and positions the cursor before the first row. This method refreshes all the data in the SDOResultSet, makes all of the newly inserted rows visible, and removes all of the deleted rows. Any local modifications that you have not sent to the AppServer before you call this method are lost.
void reOpenQuery
(String rowId) 
[Extension] 
Works like reOpenQuery(), but the first row returned is the one specified by rowId. A null rowId is equivalent to reOpenQuery(). Usually it is more efficient to call reOpenQuery(String rowId) than to first call reOpenQuery() and then call absolute(String rowId) to reposition on the specified row.

Note: If the SDOResultSet is in SDOScrollingMode.PREFETCH mode, you cannot get the rows before this rowId. For more information on SDOScrollingMode.PREFETCH, see the "Understanding SDOResultSet scrolling modes" section.

Note on SDOInterface method

The actual SmartDataObject methods supported through SDOInterface include:

For more information on these SmartDataObject methods, see OpenEdge Development: ADM and SmartObjects and OpenEdge Development: ADM Reference .
Note: A typical application does not require direct access to the SDOInterface. Direct access to SmartDataObject methods requires expert knowledge of SmartDataObject internals. In some cases, mixing direct calls to the SmartDataObject with calls through the SDOResultSet interface can leave the SDOResultSet in an unexpected state. Use the SDOInterface directly only after carefully analyzing the alternatives.


Copyright © 2005 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095